<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <!--v-for="a in b"  b代表遍历的数组  a是数组中遍历出的对象-->
    <li v-for="name in names">{{name}}</li>
</ul>
<table border="1">
    <caption>汽车列表</caption>
    <tr>
        <th>名字</th>
        <th>价格</th>
        <th>类型</th>
    </tr>
    <tr v-for="car in cars">
        <td>{{car.name}}</td>
        <td>{{car.price}}</td>
        <td>{{car.type}}</td>
    </tr>
</table>


<!--引入VUE-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    let v1 = new Vue({
        el:"ul",
        data:{
            names:["悟空","八戒","沙僧"]
        }
    })
    let v2 = new Vue({
        el:"table",
        data:{
            cars : [{name:"宝马七系",price:"1000000",type:"轿车"},
                {name:"理想ONE",price:"300000",type:"油电混合SUV"},
                {name:"奔驰GLE",price:"980000",type:"SUV"},
            ]
        }
    })
</script>
</body>
</html>